<commit_before>/**
 * Copyright 2016 IBM Corp.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    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.
 */

package main

import (
	"fmt"

	"github.ibm.com/riethm/gopherlayer/datatypes"
	"github.ibm.com/riethm/gopherlayer/services"
	"github.ibm.com/riethm/gopherlayer/sl"
	"reflect"
	"time"
)

func main() {
	session := service.NewSession("username", "apikey") // default endpoint

	session.Debug = true

	// List all Virtual Guests for an account
	//doListAccountVMsTest(&session)

	// Execute a remote script on a Virtual Guest
	//doExecuteRemoteScriptTest(&session)

	// Example: Provision and destroy a Virtual Guest
	//doCreateVMTest(&session)

	// Example: Get disk usage metrics by date
	//doGetDiskUsageMetricsTest(&session)

	// Example: Get the last bill date
	//doGetLatestBillDate(&session)
}

func doListAccountVMsTest(session *services.Session) {
	// Get the Account service
	service := session.GetAccountService()

	//Set an object mask and a result limit
	service.Mask("id;hostname;domain").Limit(10)

	// List VMs
	vms, err := service.GetVirtualGuests()
	if err != nil {
		fmt.Printf("Error retrieving Virtual Guests from Account: %s\n", err)
		return<commit_msg>Update test.go to reflect new services package name<commit_after>/**
 * Copyright 2016 IBM Corp.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    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.
 */

package main

import (
	"fmt"

	"github.ibm.com/riethm/gopherlayer/datatypes"
	"github.ibm.com/riethm/gopherlayer/services"
	"github.ibm.com/riethm/gopherlayer/sl"
	"reflect"
	"time"
)

func main() {
	session := services.NewSession("username", "apikey") // default endpoint

	session.Debug = true

	// List all Virtual Guests for an account
	//doListAccountVMsTest(&session)

	// Execute a remote script on a Virtual Guest
	//doExecuteRemoteScriptTest(&session)

	// Example: Provision and destroy a Virtual Guest
	//doCreateVMTest(&session)

	// Example: Get disk usage metrics by date
	//doGetDiskUsageMetricsTest(&session)

	// Example: Get the last bill date
	//doGetLatestBillDate(&session)
}

func doListAccountVMsTest(session *services.Session) {
	// Get the Account service
	service := session.GetAccountService()

	//Set an object mask and a result limit
	service.Mask("id;hostname;domain").Limit(10)

	// List VMs
	vms, err := service.GetVirtualGuests()
	if err != nil {
		fmt.Printf("Error retrieving Virtual Guests from Account: %s\n", err)
		return
{'fraction_non_alphanumeric': 0.10320493972361071, 'fraction_numerical': 0.005880623346074684, 'mean_word_length': 4.025110782865584, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '174908', 'n_tokens_mistral': 1040, 'n_tokens_neox': 1003, 'n_words': 358}