# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # To run this sample, define these variables first define('USER', "CU-xxx"); # name of your Rambla user account define('PWD', "xxx"); # password of your Rambla user account require_once 'raws_json/json_client.php'; require_once 'raws_json/rams_service.php'; try { $rams = new RamsService(USER, PWD); echo "\n\nGet users:"; $traffic = $rams->getUsersList(); foreach ($traffic->feed->entry as $e) { echo "\nUser = "******" with email = " . $e->content->params->email; } echo "\n\nGet used list using querystring:"; $traffic = $rams->getUsedList("from=2012-01;until=2012-12"); foreach ($traffic->feed->entry as $e) { echo "\nUsed list for user = "******" and product = " . $e->content->params->product; echo " => number of credits used = " . $e->content->params->credits; } echo "\n\nGet payed list using querystring:"; $traffic = $rams->getPayedList("from=2012-01;until=2012-12"); foreach ($traffic->feed->entry as $e) { echo "\nPayed " . $e->content->params->credits . " for formula = " . $e->content->params->formula;
# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # To run this sample, define these variables first define('USER', "xxx"); # name of your Rambla user account define('PWD', "xxx"); # password of your Rambla user account require_once 'raws_json/json_client.php'; require_once 'raws_json/rams_service.php'; try { $rams = new RamsService(USER, PWD); echo "\n\nGet total list using querystring:"; $list = $rams->getTotalList("year=curr;month=curr;type=all"); foreach ($list->feed->entry as $e) { echo "\nTotal for type = " . $e->content->params->type; echo " - volume = " . $e->content->params->volume . " - hits = " . $e->content->params->hits . " - unique users = " . $e->content->params->unique; } echo "\n\nGet traffic list for the root directory:"; $list = $rams->getTrafficList("/", "type=http,rtmp"); foreach ($list->feed->entry as $e) { echo "\nTraffic for type = " . $e->content->params->type . ", kind = " . $e->content->params->kind . " and path = " . $e->content->params->path; echo " - volume = " . $e->content->params->volume . " - hits = " . $e->content->params->hits . " - last_request = " . $e->content->params->last_request; } echo "\n\nGet top 50 domains in ascending order for the current month:"; $list = $rams->getDomainList("order=asc"); foreach ($list->feed->entry as $e) {
# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # To run this sample, define these variables first define('USER', "xxx"); # name of your Rambla user account define('PWD', "xxx"); # password of your Rambla user account require_once 'raws_json/json_client.php'; require_once 'raws_json/rams_service.php'; try { $rams = new RamsService(USER, PWD); echo "\n\nGet traffic list for the root directory:"; $traffic = $rams->getTrafficList("/", "type=http,rtmp;kind=root"); foreach ($traffic->feed->entry as $e) { echo "\nTraffic for type = " . $e->content->params->type . ", kind = " . $e->content->params->kind . " and path = " . $e->content->params->path; echo " - volume = " . $e->content->params->volume . " - hits = " . $e->content->params->hits . " - last_request = " . $e->content->params->last_request; } echo "\n\nGet traffic list for the sub-directories of the root directory:"; $traffic = $rams->getTrafficList("/", "type=http,rtmp;kind=dir"); foreach ($traffic->feed->entry as $e) { echo "\nTraffic for type = " . $e->content->params->type . ", kind = " . $e->content->params->kind . " and path = " . $e->content->params->path; echo " - volume = " . $e->content->params->volume . " - hits = " . $e->content->params->hits . " - last_request = " . $e->content->params->last_request; } echo "\n\nGet traffic list for the files inside the root directory, from 2012-01-01 until 2012-09-30 (200 entries at a time):"; $traffic = $rams->getTrafficList("/", "type=http,rtmp;kind=file;from=2012-01-01;until=2012-09-30;paginate_by=200"); while ($traffic) {