Skip to main content

Alibaba Cloud FC Util Library for Python

Project description

README

Installation

  • install with pip tool.
# install alibabacloud_fc_open20210406
pip install -U alibabacloud_fc_open20210406

Usage

  • Invoke HTTP Trigger
# -*- coding: utf-8 -*-
import os

from alibabacloud_fc_open20210406.client import Client
from alibabacloud_tea_openapi import models as open_api_models

ak = os.getenv('ak')
sk = os.getenv('sk')
url = os.getenv('url')

client = Client(config=open_api_models.Config(access_key_id=ak,
                                              access_key_secret=sk,
                                              region_id='cn-hangzhou'))

resp = client.invoke_httptrigger(url=url,
                                 method="GET", 
                                 body="anything".encode(encoding='utf-8'),
                                 headers={"k1": "v1", "k2": "v2"})
  • Invoke Anonymous HTTP Trigger
import os

from alibabacloud_fc_open20210406.client import Client
from alibabacloud_tea_openapi import models as open_api_models

ak = os.getenv('ak')
sk = os.getenv('sk')
url = os.getenv('url')

client = Client(config=open_api_models.Config(access_key_id=ak,
                                              access_key_secret=sk,
                                              region_id='cn-hangzhou'))

resp = client.invoke_anonymous_httptrigger(url=url,
                                 method="GET", 
                                 body="anything".encode(encoding='utf-8'),
                                 headers={"k1": "v1", "k2": "v2"})
  • Integration with your own http_client
import requests
import os

from alibabacloud_fc_open20210406.client import Client
from alibabacloud_tea_openapi import models as open_api_models

ak = os.getenv('ak')
sk = os.getenv('sk')
url = os.getenv('url')

client = Client(config=open_api_models.Config(access_key_id=ak,
                                              access_key_secret=sk,
                                              region_id='cn-hangzhou'))

# build your own request
req = requests.Request(
    url=url,
    method='GET'
)
req = client.sign_request(req)
with requests.Session() as s:
    prep=s.prepare_request(req)
    resp = s.send(prep)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alibabacloud_gateway_fc_util-0.0.4.tar.gz (4.4 kB view details)

Uploaded Source

File details

Details for the file alibabacloud_gateway_fc_util-0.0.4.tar.gz.

File metadata

  • Download URL: alibabacloud_gateway_fc_util-0.0.4.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.2

File hashes

Hashes for alibabacloud_gateway_fc_util-0.0.4.tar.gz
Algorithm Hash digest
SHA256 2d4409cf3b3ce280f7d9d4c1c0e770f5b72f8d1beabc877ba66bb10721e44b57
MD5 42c98ec44a60ff48e45d37396ab490d3
BLAKE2b-256 a2a0b4d0bbb2ffd3fbcf2a5644d21cd5152d058f83e11489dd1c4b4e680230f8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page