google cloud storage - GCS - Create bucket from App Engine - 403:Forbidden error -
i trying create gcs bucket using java api app engine project.
i following error not further information.
403 forbidden { "code" : 403, "errors" : [ { "domain" : "global", "message" : "forbidden", "reason" : "forbidden" } ], "message" : "forbidden" }
based on reading on internet, have checked following
enable billing - done.. enable googlecloudstorage api - done ..
inspite of doing these, see error.
this how creating storage object ---
httptransport = googlenethttptransport.newtrustedtransport(); json_factory = jacksonfactory.getdefaultinstance(); credential = googlecredential.getapplicationdefault(); //add scopes list<string> colls = new arraylist<string>(); colls.addall(storagescopes.all()); if (credential.createscopedrequired()) { credential = credential.createscoped(colls); } //build storage storage = new storage.builder(httptransport, json_factory, credential).setapplicationname("projectname").build(); bucket newbucket = storage.buckets().insert("projectname", new bucket() .setname(bktname).setlocation("us")).execute();
the same code used work in different project. however, unable create buckets 403 error on new project have created..
hope hear guys !!!
thanks,
srikanth
did enable google cloud storage json api (via google developers console) project?
as side note, may want consider using gcloud-java storage should better experience on java.
Comments
Post a Comment