hetzner-cloud-api-net icon indicating copy to clipboard operation
hetzner-cloud-api-net copied to clipboard

We couldn't get the server details from hetzners cloud server using hetzner cloud-api-net.

Open RajuSPR opened this issue 7 years ago • 19 comments

We couldn't get the server details from hetzners cloud server using hetzner cloud-api-net.

We are trying to get the servers since last week. But couldn't do it. Here I had attached the screenshots for your reference. I had followed by the below steps to get the server details. Finally, my request is terminated in one method without any response. Please give any suggestion or solution for me.

Step 1:

image

Step 2: Above request is going to the GetAsync method in Server.cs. There is a call for SendRequest method in this method.

string responseContent = await ApiCore.SendRequest(url);

image

Step 3:

Finally, my request is terminated in the following highlighted code. image

Above method didn't return any values. the request goes for the GetStringAsync method, at this time request was terminated. Please help me. I'm in a critical situation. Please check and find the solution for my issue.

RajuSPR avatar Apr 10 '19 14:04 RajuSPR

Hi, I will try to help. Which project type do you use? Xamarin, UWP, Android, iOS, Windows, etc. Is there no exception?

lk-code avatar Apr 10 '19 14:04 lk-code

I have used a web application( Asp .net C# ). Yes, that is correct. It didn't return any exception message. But it's return some result as follows "Id = 7, Status = WaitingForActivation, Method = "{null}", Result = "{Not yet computed}"

RajuSPR avatar Apr 11 '19 05:04 RajuSPR

Your API token is correct and active? 😋 can you See any http response Insider the Methode? I Tested it yesterday and it works correct.

lk-code avatar Apr 11 '19 05:04 lk-code

My API token is correct. But how can I identify it's active or not.

RajuSPR avatar Apr 11 '19 05:04 RajuSPR

maybe another user has delete the key at the hetzner console 😉. can you send me the code in which you start the request?

lk-code avatar Apr 11 '19 08:04 lk-code

Yeah sure. Already I had attached the screenshot in the initial post. I'll send to you again.

    public static async Task server ()
    {
        lkcode.hetznercloudapi.Core.ApiCore.ApiToken = "Here My API Token"; 
        List<lkcode.hetznercloudapi.Api.Server> serverList = await lkcode.hetznercloudapi.Api.Server.GetAsync();
        
    }

RajuSPR avatar Apr 11 '19 09:04 RajuSPR

Please find out my issue and give me the solution.

RajuSPR avatar Apr 11 '19 16:04 RajuSPR

Anmerkung 2019-04-11 231429

I just created a fresh ASP.NET project (classic - no .NET Core). Then the library is loaded via NuGet and the servers are loaded as in the screenshot. It worked.

lk-code avatar Apr 11 '19 21:04 lk-code

Anmerkung 2019-04-11 231430

also with your method the servers are loaded correctly.

lk-code avatar Apr 11 '19 21:04 lk-code

image

I was thinking that maybe the API token is invalid, but then the Hetzner server returns an HTTP-401.

lk-code avatar Apr 11 '19 21:04 lk-code

can you send me your api token on a private way. Maybe there is something in your server response, which is not displayed with me. If I've checked that, you can delete the API token ;).

lk-code avatar Apr 11 '19 21:04 lk-code

Can you please share your personal email for send my api token.

RajuSPR avatar Apr 12 '19 10:04 RajuSPR

you can send it to [email protected]

lk-code avatar Apr 12 '19 11:04 lk-code

Thanks a lot @lk-code . It's working fine. It's possible on a console application?

RajuSPR avatar Apr 12 '19 16:04 RajuSPR

I have not tested every project type, but the library is compiled as a .NET standard. So it should run in any supported project

lk-code avatar Apr 12 '19 19:04 lk-code

Thank you very much!......... I have one more doubt. How can I find out One server floating IPs, locations, Images, and Volumes? For example, I need one server details with that server location details. How can I get this? Any conjunctions fields are available between servers and locations.

RajuSPR avatar Apr 16 '19 12:04 RajuSPR

Can you please help me.

RajuSPR avatar Apr 25 '19 05:04 RajuSPR

How can I get the server types, Datacenters, image details for the particular server using Hetzner cloud API?.

RajuSPR avatar Apr 25 '19 05:04 RajuSPR

I need clarification about the Hetzners cloud API. I have developed the new web application to access the servers using Hetzner cloud API. I had successfully gotten the following server details using hetzner cloud API (Name, Id, Status, Created date, IPv4, IPv6). But I need more server details. How can I get the server types, Datacenters, image details for the particular server using Hetzner cloud API?. Can you please help me.

image

RajuSPR avatar Apr 26 '19 05:04 RajuSPR