Skip to content

Instantly share code, notes, and snippets.

View CribberSix's full-sized avatar

Cribber CribberSix

  • Germany
View GitHub Profile
from datetime import datetime
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.hooks.S3_hook import S3Hook
def upload_file(ds, **kwargs):
with open("/tmp/test.txt", "w") as fp:
# Creating the content and flushing it.
{
"aws_access_key_id":"minio_admin",
"aws_secret_access_key": "minio_password",
"host": "http://myminio:9000"
}
Rest endpoint: http://mynifi:8080/nifi-api/processors/1462a26f-0000-0000-0000-35550911fe94
Response: <Response [200]>
Processor: {'revision': {'version': 0}, 'id': '1462a26f-bf20-391a-a4d9-35550911fe94', 'uri': 'http://mynifi:8080/nifi-api/processors/1462a26f-0000-0000-0000-35550911fe94', 'position': {'x': 936.0, 'y': 304.0}, 'permissions': {'canRead': True, 'canWrite': True}, 'bulletins': [], ....
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.hooks.base_hook import BaseHook
from airflow.utils.trigger_rule import TriggerRule
import json
from datetime import datetime
import requests
from urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning) # disable warnings
from airflow import DAG
# path for Airflow version 1.10.9:
from airflow.operators.postgres_operator import PostgresOperator
# path for Airflow version 2.4.0:
# from airflow.providers.postgres.operators.postgres import PostgresOperator
import datetime
with DAG(
dag_id="hello_postgres_postgres_operator",
start_date=datetime.datetime(2021, 12, 17),
boto3
[default]
accessKey=minio_admin
secretKey=minio_password
SELECT 1 as one;
SELECT 1;
docker inspect b5f16b1d7bc3 | grep IPAddresss