f5teem

package module
v0.0.0-...-0144d87 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

README

f5-teem

Go Module providing an interface for F5's TEEM infrastructure to provide usage analytics to F5.

Usage (Anonymous API)


package main

import (
	"github.com/RavinderReddyF5/f5-teem"
	"log"
)

func main() {
	assetInfo := f5teem.AssetInfo{
		"Terraform-Provider-BIGIP-Ecosystem",
		"1.2.0",
		"",
	}
	teemDevice := f5teem.AnonymousClient(assetInfo, "")
	d := map[string]interface{}{
		"Device":          1,
		"Tenant":          1,
		"License":         1,
		"DNS":             1,
		"NTP":             1,
		"Provision":       1,
		"VLAN":            2,
		"SelfIp":          2,
		"platform":        "BIG-IP",
		"platformVersion": "15.1.0.5",
	}
	err := teemDevice.Report(d, "Terraform BIGIP-ravinder-latest", "1")
	if err != nil {
		log.Printf("Error:%v", err)
	}
}

Example Telemetry Record

{
    "digitalAssetName": "f5-example-product",
    "digitalAssetVersion": "1.0.0",
    "digitalAssetId": "<asset UUID>",
    "documentType": "Installation Usage",
    "documentVersion": "1",
    "observationStartTime": "",
    "observationEndTime": "",
    "epochTime": "",
    "telemetryId": "",
    "telemetryRecords": [
        {
        "Device":          1,
        "Tenant":          1,
        "License":         1,
        "DNS":             1,
        "NTP":             1,
        "Provision":       1,
        "VLAN":            2,
        "SelfIp":          2,
        "platform":        "BIG-IP",
        "platformVersion": "15.1.0.5",
	   }]
}

Use TEEM staging environment

Set environment variable

export TEEM_API_ENVIRONMENT='staging'

Additional Notes

This library is similar to the node-based f5-teem library (https://www.npmjs.com/package/@f5devcentral/f5-teem), python library(https://pypi.org/project/f5-teem/)

Documentation

Overview

*

  • Copyright 2020 F5 Networks, Inc. *
  • 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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetInfo

type AssetInfo struct {
	Name    string `json:"name,omitempty"`
	Version string `json:"version,omitempty"`
	Id      string `json:"id,omitempty"`
}

type TeemObject

type TeemObject struct {
	//EndpointInfo interface{}
	ClientInfo           AssetInfo
	ApiKey               string
	TelemetryType        string
	TelemetryTypeVersion string
	ServiceHost          string
}

func AnonymousClient

func AnonymousClient(assetInfo AssetInfo, apiKey string) *TeemObject

func (*TeemObject) Report

func (b *TeemObject) Report(telemetry map[string]interface{}, telemetryType, telemetryTypeVersion string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL