google-cloud-dotnet | Google Cloud Client Libraries for .NET | GCP library
kandi X-RAY | google-cloud-dotnet Summary
kandi X-RAY | google-cloud-dotnet Summary
Google Cloud Client Libraries for .NET
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of google-cloud-dotnet
google-cloud-dotnet Key Features
google-cloud-dotnet Examples and Code Snippets
Community Discussions
Trending Discussions on google-cloud-dotnet
QUESTION
I am using a downloaded JSON file containing service account keys, instead of ADC, with code running on my local developer machine and communicating with live GCP Firestore.
After adding a service account to a role, in my case roles/datastore.user
, do I have to do anything before it takes effect?
E.g. wait 15 minutes, redownload the JSON, restart some services, something else?
Question relates to this error in automated tests running on my machine.
...ANSWER
Answered 2022-Jan-21 at 17:57The permission denied problem was being caused by an incorrect project name (and not permission actually being denied).
At the top of the Google Cloud Console is the name of the current project. However, that's actually just a pointless alias, the real project identifier is not displayed by default, though it is in the URL in the browser.
Of course, the error message implies it found its target resource and it denied access.
I'm so tired.
QUESTION
Background
On the Google Kubernetes Engine we've been using Cloud Endpoints, and the Extensible Service Proxy (v2) for service-to-service authentication.
The services authenticate themselves by including the bearer JWT token in the Authorization
header of the HTTP requests.
The identity of the services has been maintained with GCP Service Accounts, and during deployment, the Json Service Account key is mounted to the container at a predefined location, and that location is set as the value of the GOOGLE_APPLICATION_CREDENTIALS
env var.
The services are implemented in C# with ASP.NET Core, and to generate the actual JWT token, we use the Google Cloud SDK (https://github.com/googleapis/google-cloud-dotnet, and https://github.com/googleapis/google-api-dotnet-client), where we call the following method:
...ANSWER
Answered 2021-Aug-02 at 14:21To get an IdToken for the attached service account, you can use GoogleCredential.GetApplicationDefault().GetOidcTokenAsync(...)
.
QUESTION
I'm looking over the Google Cloud Client Libraries for .NET and cannot find a way to create a TLS/SSL certificate on a load balancer.
In the console, I can fill out the form and click on the "Equivalent REST" to view the REST call:
...ANSWER
Answered 2021-Feb-19 at 10:29From your post I understand you have two separate questions.
The first one would be how to create an SSL certificate using the API for your Load Balancer, information on how this is done can be found here and here, where you will find additional information on SSLcertificates resources. To associate your certificate to the Load Balancer you can follow these guides, depending on your needs:
For your second question about authenticating the client for API use, the following guide might prove useful to you.
QUESTION
In Google.Cloud.PubSub.V1 version 1.x.x, I was using PublisherServiceApiClient.Create and passing in "Channel" object, which was configured with target, credentials, and ChannelOptions. The ChannelOptions are grpc.max_receive_message_length and then grpc.max_send_message_length.
According to the documentation (https://googleapis.github.io/google-cloud-dotnet/docs/Google.Cloud.PubSub.V1/api/Google.Cloud.PubSub.V1.SubscriberServiceApiClient.html#Google_Cloud_PubSub_V1_SubscriberServiceApiClient_Create) you have to use SubscriberServiceApiClientBuilder (if you are not going to use default values: https://googleapis.github.io/google-cloud-dotnet/docs/Google.Cloud.PubSub.V1/api/Google.Cloud.PubSub.V1.SubscriberServiceApiClientBuilder.html).
SubscriberServiceApiClientBuilder allows you set ChannelCredentials, and Endpoint, but I don't see a way to set the ChannelOptions. How do I set the ChannelOptions in SubscriberServiceApiClientBuilder?
Old code for creating SubScriberServiceApiClient:
SubscriberServiceApiClient.Create(channel); // channel is of type Channel
New code for creating SubscriberServiceApiClient:
...ANSWER
Answered 2021-Feb-12 at 22:03As you pointed out, SubscriberServiceApiClient.Create()
has stopped accepting grpccore::Channel
object. But you can still create a client by creating an underlying SubscriberServiceApiClientImpl
object directly.
To elaborate more, SubscriberServiceApiClientImpl
takes in a Subscriber.SubscriberClient
object, that is derived from the channel
variable (a grpccore::Channel
object) that you wish to pass in. You can check the old implementation for how the grpcClient
is created.
So in sum, your code may look like the following:
QUESTION
How do I use the GCP enum TextAnnotation.Types.DetectedBreak.Types.BreakType
in my python code?
I assume I import it somehow, but do not know how.
ANSWER
Answered 2020-Nov-18 at 17:32It looks like you're linking to the .NET docs, but asking about Python. If you want to use these enums from Python, you'll first need to install the Google Cloud Vision client library from PyPI:
QUESTION
I am creating several FirestoreChangeListeners (following the User Guide at https://googleapis.github.io/google-cloud-dotnet/docs/Google.Cloud.Firestore/userguide.html) and everything is working fine, but when there is a network problem, a System.AggregateException is being thrown with the inner exception being a Grpc.Core.RpcException with Status of "Transport Closed" or "Failed to connect" (This makes sense).
The problem is I can't figure out how to catch or handle these inner exceptions, which are thrown by the FirestoreChangeListeners, or how I should structure the method to do be able to do this.
I've tried adding try/catch in multiple places, tried adding ContinueWith to the listener, but regardless I still get unhandled System.AggregateException.
The documentation says the Listen method is a "convenience" method that supposedly helps in monitoring the Listener... and it does include a ListenerTask method that returns a Task. Perhaps I need to do something with these tasks... Everything I have read suggestions I should await this, but since it's an async listener that runs in the background for the whole time the program is running, I'm not sure what method should await... wouldn't await block the whole method?
My code is:
...ANSWER
Answered 2020-Oct-23 at 03:47As per Jon's investigation at https://github.com/googleapis/google-cloud-dotnet/issues/5462, there is a bug in the underlying gRPC code.
Suggested workaround by Jon is also working fine and a good solution to this problem:
QUESTION
I've been pretty frustrated trying to find a good developer reference for Google.Cloud.Storage.V1
I want to do a simple HEAD operation to check a bucket exists: https://cloud.google.com/storage/docs/xml-api/head-bucket#example
How do I do this with the library? I can't find a method for this: https://github.com/googleapis/google-cloud-dotnet/tree/master/apis/Google.Cloud.Storage.V1/Google.Cloud.Storage.V1
...ANSWER
Answered 2020-Sep-24 at 07:14The XML-API method tells you if the bucket exist and if you have the right on it.
Indicates if a bucket exists and whether the requester has READ access to it.
You can do the equivalent with the GET bucket rest API
Thus, the getBucket method is the closest to what you want to achieve
QUESTION
Hello and thanks for reading my question.
I'm working on transitioning some code from Google.Cloud.Translation.V2
to Google.Cloud.Translate.V3
because we need to make use of the api advanced features.
We are using a TranslationClient
to get us the translations (from the V2 library) but we need to instead use the TranslationServiceClient
(from the V3 library.)
I'm having trouble instantiating a TranslationServiceClient
with our credentials. The way to do it in V2 is straightforward:
ANSWER
Answered 2020-Jul-08 at 15:35Since the goal is to create a TranslationServiceClient
using a json as authentication, one way to do this is as follows:
QUESTION
I am using Google.Cloud.Vision.V1, Version=2.0.0.0
and the following below code from Google Vision API specify JSON file
ANSWER
Answered 2020-May-17 at 14:44It seems that you are using newer version of API. Docs state that now authentication is set up(when needed) via environment variable:
Otherwise, the simplest way of authenticating your API calls is to download a service account JSON file then set the GOOGLE_APPLICATION_CREDENTIALS environment variable to refer to it. The credentials will automatically be used to authenticate. See the Getting Started With Authentication guide for more details.
So you can do something like this:
QUESTION
I use google cloud dialogflow API.
I would like to set VoiceSelectionParams's name field.
However, I can't find a list of name field anywhere.
I serched "dialogflow VoiceSelectionParams name" on the Internet, but I couldn't find any hint.
Could you give me any advice? Thank you in advance.
...ANSWER
Answered 2020-May-15 at 07:51The voices available for Dialogflow are the same ones as the ones for Cloud Text-to-Speech.
You can see a list of them here.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install google-cloud-dotnet
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page