https://pulumi.com logo
#python
Title
# python
b

bland-lamp-16797

10/27/2020, 11:17 AM
I think I found the bug, when I run:
Copy code
pulumi_gcp.cloudscheduler.Job("what ever",
                              description="whatever",
                              schedule="5 4 * * *",
                              http_target={
                                  'uri': '<https://cloudbuild.googleapis.com/v1/projects/PROJECT_ID/triggers/TRIGGER_ID:run>',
                                  'body': '{}',
                                  'oauth_token': {
                                      'service_account_email': '<mailto:PROJECT_ID@appspot.gserviceaccount.com|PROJECT_ID@appspot.gserviceaccount.com>',
                                      'scope': '<https://www.googleapis.com/auth/cloud-platform>'
                                  }
                              }
                              )
whatever I put in
'body': '{}',
I get
Error creating Job: googleapi: Error 400: Invalid value at 'job.http_target.body' (TYPE_BYTES), Base64 decoding failed for "{}".
Should I open the bug for this or I'm totally missing what should be in body ? The body Regex should be
[a-zA-Z\d_-]{1,500}
ohh jesus it's not bug... it's... pain
'body': base64.b64encode('{"branchName": "master"}'.encode('ascii')).decode('ascii'),
e

echoing-dawn-86996

01/04/2021, 9:13 PM
Good that I thought of searching slack... You saved me a few hours of pain. Thank you! This should definitely be documented somewhere
b

bland-lamp-16797

01/11/2021, 12:46 PM
yeah, it took me awhile! glad it helped
6 Views