Skip to content

No resource found, even though the resource should exist. #91

@RobinMatter6

Description

@RobinMatter6

I am trying to find the primary hanode. To achieve this, I attempted to retrieve all available hanodes as follows:

package main

import (
	"fmt"
	"log"
	"github.com/citrix/adc-nitro-go/service"
)

func main() {
	client, err := service.NewNitroClientFromEnv()

	if err != nil {
		log.Fatalf("Error creating Nitro client: %v", err)
	}

	client.Login()
	hanode, err := client.FindAllResources(service.Hanode.Type())

	if err != nil {
		log.Fatalf("Error finding all hanodes: %v", err)
	}

	fmt.Printf("hanode: %v", hanode)
	client.Logout()
	fmt.Println("")
}

This returns: hanode: []

I expected it to find a hanode because, when I check https://<IP>/nitro/v1/config/hanode, I receive the following response:

{
  "errorcode": 0,
  "message": "Done",
  "severity": "NONE",
  "hanode": [
    {
      "id": "0",
      "name": "server-name",
      "ipaddress": "xxx.xxx.xxx.xxx",
      "flags": "129",
      "hastatus": "UP",
      "state": "Primary",
      "hasync": "ENABLED",
      "haprop": "ENABLED",
      "enaifaces": "0/1",
      "netmask": "0.0.0.0",
      "inc": "DISABLED",
      "ssl2": "NOT PRESENT",
      "hellointerval": 200,
      "deadinterval": 3,
      "masterstatetime": 19121744,
      "failsafe": "OFF",
      "routemonitor": "xxx.xxx.xxx.xxx",
      "maxflips": "0",
      "maxfliptime": "0",
      "curflips": "0",
      "completedfliptime": "0",
      "routemonitorstate": "DOWN",
      "syncstatusstrictmode": "DISABLED"
    }
  ]
}

It seems that the hanode exists and should be queryable. However, I do not find a resource when searching with the Nitro client. What am I doing wrong in my attempt to determine which hanode is the primary?

I highly appreciate your help. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions