Code Monkey home page Code Monkey logo

Comments (3)

apricote avatar apricote commented on June 21, 2024 1

Can reproduce, request and response bodies:

--- Request:
POST /v1/firewalls/1254648/actions/set_rules HTTP/1.1
Host: api.hetzner.cloud
User-Agent: hcloud-cli/1.43.0-dev hcloud-go/2.7.0
Content-Length: 499
Authorization: REDACTED
Content-Type: application/json
Accept-Encoding: gzip

{"rules":[{"direction":"in","source_ips":["0.0.0.0/0"],"destination_ips":[],"protocol":"tcp","port":"22","description":null},{"direction":"out","source_ips":[],"destination_ips":["::/0"],"protocol":"tcp","port":"443","description":null},{"direction":"in","source_ips":["2001:db8:123:4567::/64"],"destination_ips":[],"protocol":"tcp","port":"22","description":null},{"direction":"in","source_ips":["12.34.56.78/32"],"destination_ips":null,"protocol":"tcp","port":"2205","description":"Temp access"}]}

--- Response:
HTTP/2.0 422 Unprocessable Entity
Content-Length: 286
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization
Access-Control-Allow-Methods: GET, PUT, POST, DELETE, PATCH, OPTIONS
Access-Control-Allow-Origin: *
Access-Control-Max-Age: 1728000
Content-Type: application/json
Date: Fri, 05 Apr 2024 15:30:39 GMT
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Correlation-Id: 34395fd8f78fd233

{
  "error": {
    "message": "invalid input in field 'rules'",
    "code": "invalid_input",
    "details": {
      "fields": [
        {
          "name": "rules.3.destination_ips",
          "messages": [
            "Field may not be null."
          ]
        }
      ]
    }
  }
}

from cli.

phm07 avatar phm07 commented on June 21, 2024

This was introduced with hetznercloud/hcloud-go#396 and is an unexpected inconsistency with the API. The API does not emit the destination_ips field in responses, but expects it to be omitted in requests. (Same probably goes for description)

from cli.

apricote avatar apricote commented on June 21, 2024

Fixed in v1.43.1.

Thanks for the report @Dari4sho!

from cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.