@@ -292,6 +292,31 @@ func (c *Client) GetProject(name string) (*LogProject, error) {
292292 return proj , err
293293}
294294
295+ // GetProjectCrossRegion gets project information with cross-region lookup enabled.
296+ // This API is available only in some regions.
297+ func (c * Client ) GetProjectCrossRegion (name string ) (* LogProject , error ) {
298+ h := map [string ]string {
299+ "x-log-bodyrawsize" : "0" ,
300+ }
301+
302+ uri := "/?crossRegion=true"
303+ proj := convert (c , name )
304+ resp , err := request (proj , "GET" , uri , h , nil )
305+ if err != nil {
306+ return nil , NewClientError (err )
307+ }
308+ defer resp .Body .Close ()
309+ buf , err := ioutil .ReadAll (resp .Body )
310+ if err != nil {
311+ return nil , readResponseError (err )
312+ }
313+ if resp .StatusCode != http .StatusOK {
314+ return nil , httpStatusNotOkError (buf , resp .Header , resp .StatusCode )
315+ }
316+ err = json .Unmarshal (buf , proj )
317+ return proj , err
318+ }
319+
295320// ListProject list all projects in specific region
296321// the region is related with the client's endpoint
297322func (c * Client ) ListProject () (projectNames []string , err error ) {
0 commit comments