Code Monkey home page Code Monkey logo

Comments (4)

nikhilsbhat avatar nikhilsbhat commented on September 18, 2024

Good to know that this library is helpful for you.
Can you elaborate the problem with some example?

Getting a specific cluster profile is supported and it is working for me. Check this out in the example

Have used the same in the terraform provider too, for ref.

from gocd-sdk-go.

umairarcis avatar umairarcis commented on September 18, 2024

Here is my code to getClusterProfile(name)

func (u UserImpl) GetClusterProfileById(id string) (gocd.CommonConfig, error) {
	fmt.Println("Profile:", id)
	get, err := client.GetClusterProfile(id)
	fmt.Println("Get Cluster", get)
	if err != nil {
		fmt.Println("This error occurs inside Dao GetClusterProfileById function", err)
	}
	return get, err
}

func GetClusterProfileByName(w http.ResponseWriter, r *http.Request)  {
	w.Header().Set("Content-Type", "application/json")
	n := mux.Vars(r)
	getById, err  := dao2.GetClusterProfileById(n["id"])
	fmt.Println("Get By ID:", getById)
	if err != nil {
		fmt.Println("This error occurs while getting Cluster Profile By Name", err)
	}
	json.NewEncoder(w).Encode(getById)
}

Following Error output-

Profile: cluster4
{"level":"warning","msg":"Using Basic Auth in HTTP mode is not secure, use HTTPS","time":"2023-04-07T11:46:51+05:30"}
Get Cluster {     false [] [] }
This error occurs inside Dao GetClusterProfileById function got 400 from GoCD while making GET call for http://server-ip:port/go/%5Capi%5Cadmin%5Celastic%5Ccluster_profiles%5Ccluster4
with BODY:
Get By ID: {     false [] [] }
This error occurs while getting Cluster Profile By Name got 400 from GoCD while making GET call for http://server-ip:port/go/%5Capi%5Cadmin%5Celastic%5Ccluster_profiles%5Ccluster4
with BODY:

Hope it is helpful

from gocd-sdk-go.

nikhilsbhat avatar nikhilsbhat commented on September 18, 2024

Hey @arcis123umair,

May I know the GoCD version and also the library version that is being used?
I will try to reproduce the issue in my local.

from gocd-sdk-go.

umairarcis avatar umairarcis commented on September 18, 2024

Hello @nikhilsbhat

GoCD version: v22.3.0
Library version: v0.1.1

from gocd-sdk-go.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.