I looked the gcf source code in share_domain function:

func (repo CloudControllerDomainRepository) CreateSharedDomain(domain cf.Domain) (apiResponse net.ApiResponse) {
         path := repo.config.Target + "/v2/domains"
         data := fmt.Sprintf(`{"name":"%s","wildcard":true}`, domain.Name)
         return repo.gateway.CreateResource(path, repo.config.AccessToken, strings.NewReader(data))
}

I found that the way that gcf call cloud_controller domain api is as the same as the cf cli did. The request to create shared domain is like this:
{"name":"vcap.me","wildcard":true}

In the request body(json format), there is no *owning_organization_guid *property so that the request return error showed above.
It seems like that the cc api does not match the request. I just don't know why..


在 2013年11月11日星期一UTC+8下午12时19分41秒,James Bayer写道:
i'm not sure of the exact usage with the ruby cf cli as i haven't tried
this use case myself. can you try the new go cli (gcf is the name during
the beta).
https://github.com/cloudfoundry/cli#downloading-edge

i suspect that you'll also need to be an admin user (a user with
cloud_controller.admin OAuth scope)

$ gcf help share-domain

NAME:

share-domain - Share a domain with all orgs

USAGE:

gcf share-domain DOMAIN


On Sun, Nov 10, 2013 at 8:02 PM, Alan Sun <alan...@gmail.com <javascript:>
wrote:
I want to create a shared domain between different orgs. I checked the cf
command line document:


QUALIFIER REQUIRED DESCRIPTION –name NAME Domain name. Specify a domain
in top-level format, for example, mydomain.com. –shared Make the domain
shared. –space SPACE The space to which to map the domain. If not
specified, the domain is mapped to the current space. -o, –organization,
–org ORGANIZATION The organization to which to map the domain. If not
specified, the domain is mapped to the current organization.
So i use the '--shared' param and create a domain belonging to org1 like
this:
* cf map-domain vcap.me <http://vcap.me> -o org1 --shared*

But return error:

*[root@st01-sdc-cf14 ~]# cf map-domain vcap.me <http://vcap.me> -o org1
--shared*
*Creating domain vcap.me... FAILED*
*CFoundry::MessageParseError: 1001: Request invalid due to parse error:
Field: owning_organization_guid, Error: Missing field
owning_organization_guid*

Did anyone encounter this error? How should i do to created shared
domain between different orgs?
*The relation between org and domain is many-to-many,right? *

To unsubscribe from this group and stop receiving emails from it, send
an email to vcap-dev+u...@cloudfoundry.org <javascript:>.


--
Thank you,

James Bayer
To unsubscribe from this group and stop receiving emails from it, send an email to vcap-dev+unsubscribe@cloudfoundry.org.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 9 | next ›
Discussion Overview
groupvcap-dev @
postedNov 11, '13 at 4:02a
activeNov 12, '13 at 3:50a
posts9
users3

People

Translate

site design / logo © 2021 Grokbase