# Go-rancher client project id

**URL:** <https://forums.suse.com/t/go-rancher-client-project-id/3398>\
**Category:** Rancher 1.x\
**Created:** [July 13, 2016, 9:08pm UTC](https://forums.suse.com/t/go-rancher-client-project-id/3398 "2016-07-13T21:08:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![blackjid](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/blackjid/32/1493_2.png) [@blackjid](https://forums.suse.com/u/blackjid)\
**Post date:** [July 13, 2016, 9:08pm UTC](https://forums.suse.com/t/go-rancher-client-project-id/3398/1 "2016-07-13T21:08:55Z")

</div>

Hi!, I’m using the go-rancher library to build a terraform provider for rancher.

I’m setting the url for the client as [http://localhost:8080/v1](http://localhost:8080/v1), I’m able to create new environments, but now I want to create resources within an environment (e.g. registries).

Is it possible to use the same client to get to the correct environment (project) using go-rancher???

I have

```go
client, err := rancher.NewRancherClient(&rancher.ClientOpts{
    Url: "http://localhost:8080/v1",
    AccessKey: "my_access_key",
    SecretKey: "my_secret_key",
})

```

I would like to be able to do something like

```go
client.Url = "http://localhost:8080/v1/projects/1a23/schemas"

```

And then use the same client but pointing to the correct environment.  
I also understand that there is a special header `x-api-project-id` that I can set but I don’t know if the go client support passing this header or how to do it.

Thanks!

---

<div class="post-metadata">

**Author:** ![cloudnautique](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/cloudnautique/32/26_2.png) [@cloudnautique](https://forums.suse.com/u/cloudnautique)\
**Post date:** [July 13, 2016, 10:06pm UTC](https://forums.suse.com/t/go-rancher-client-project-id/3398/2 "2016-07-13T22:06:17Z")

</div>

Hi @blackjid,

Take a look at this project, it does similar calls so it shoud provide some examples.

[https://github.com/cloudnautique/rbs-sandbox](https://github.com/cloudnautique/rbs-sandbox)

The version of Go Rancher is slightly dated, but it should still work. I need to finish this thing up one of these days 🙂
