当前位置: 首页 > news >正文

什么网站做任务百度首页登录

什么网站做任务,百度首页登录,拉萨新闻最新消息今天,微官网和微网站首页目录 背景介绍 系统运维管理OOS 文件转存场景 前提条件 实践步骤 附录 示例模板 背景介绍 系统运维管理OOS 系统运维管理OOS(CloudOps Orchestration Service)提供了一个高度灵活和强大的解决方案,通过精巧地编排阿里云提供的OpenAPI…

目录

背景介绍

系统运维管理OOS

文件转存场景

前提条件

实践步骤

附录

示例模板


背景介绍

系统运维管理OOS

系统运维管理OOS(CloudOps Orchestration Service)提供了一个高度灵活和强大的解决方案,通过精巧地编排阿里云提供的OpenAPI,使得用户能够将分散的单个原子运维任务链接起来,形成复杂的运维场景和流程。这种方式不仅大幅提升了运维的效率,也极大地减少了人为错误的可能性。更进一步,OOS的编排能力不仅限于基础的云服务管理操作,它还扩展到了阿里云的其他核心服务如函数计算FC和对象存储OSS。

文件转存场景

对于http文件转存到对象存储的场景,经典的做法通常涉及一个繁琐的双步骤过程:首先,用户需要手动下载目标文件至本地存储;随后,通过使用命令行工具或编写特定脚本,再将文件上传到云端的对象存储服务。这个流程不仅效率较低,还需要用户依赖于本地硬件资源或者支付额外费用租用阿里云上的ECS实例。

然而,借助于阿里云OOS这一过程得到了极大简化和优化。用户无需依赖任何本地硬件或者额外的云服务实例,仅需在阿里云的函数计算服务上执行一段定制的Python脚本。利用了云计算的弹性和函数计算的无服务器(Serverless)特性,实现了从HTTP源直接将文件高效转存到对象存储的目的。这样不仅消除了对物理硬件或计算实例的需求,而且极大降低了操作成本,提升了数据处理的效率。此外,这一过程的自动化也意味着可以极大减少因手动操作引入的错误。

前提条件

  • 使用此功能必须开通函数计算服务。
  • 创建执行前需要为FC创建RAM角色并授予访问OSS的权限。

实践步骤

  1. 登录 OOS 控制台并使用附录中示例模板创建自定义模板。您可以参考FC提供的Python开发指南自定义脚本和模板。
  2. 模板创建完成后,配置参数并创建执行。执行成功后,在目标OSS Bucket中可以看到已下载的文件。

image.png

附录

示例模板

FormatVersion: OOS-2019-06-01
Description:en: FC runs script, To use this template, you must first <a href='https://help.aliyun.com/zh/functioncompute/getting-started/quickly-create-a-function#p-t79-y7o-68z' target="_blank">activate the function computing service< /a>zh-cn: FC运行脚本,使用此功能必须<a href='https://help.aliyun.com/zh/functioncompute/getting-started/quickly-create-a-function#p-t79-y7o-68z' target="_blank">开通函数计算服务</a>name-en: FC-RunScriptname-zh-cn: FC运行脚本
Parameters:FileUrl:Label:en: FileUrlzh-cn: 文件存储URLType: StringOSSRegionId:Label:en: OSSRegionIdzh-cn: OSS bucket所在地域IDType: StringAssociationProperty: RegionIdOSSBucketName:Label:en: OSSBucketNamezh-cn: OSS Bucket 名称Type: StringAssociationProperty: ALIYUN::OSS::Bucket::BucketNameAssociationPropertyMetadata:RegionId: ${OSSRegionId}Default: ''OSSDirectory:Type: StringLabel:en: OSSDirectoryzh-cn: OSS目录Description:en: The directory where files are stored in the OSS Bucket. / is used to split the path and quickly create subdirectories. However, do not start with / and do not appear consecutive / s.zh-cn: 文件存储在 OSS Bucket 中的目录,/ 用于分割路径,可快速创建子目录,但不要以 / 开头,不要出现连续的 / 。Default: Download/Demo/FCAssumeRole:Label:en: FCAssumeRolezh-cn: FC扮演的RAM角色Description:en: The Function Compute platform will use this RAM role to generate a temporary key for accessing your Alibaba Cloud resources and pass it to your code. For details, please see <a href="https://help.aliyun.com/zh/functioncompute/user-guide/grant-function-compute-permissions-to-access-other-alibaba-cloud-services" target="_blank ">Grant Function Compute permissions to access other cloud services</a>zh-cn: 函数计算平台会使用这个 RAM 角色(Role)来生成访问您的阿里云资源的临时密钥,并传递给您的代码。详情请查看<a href="https://help.aliyun.com/zh/functioncompute/user-guide/grant-function-compute-permissions-to-access-other-alibaba-cloud-services" target="_blank">授予函数计算访问其他云服务的权限</a>Type: StringAssociationProperty: ALIYUN::RAM::Service::RoleAssociationPropertyMetadata:Service: fc.aliyuncs.comDefault: ''OOSAssumeRole:Label:en: OOSAssumeRolezh-cn: OOS扮演的RAM角色Type: StringDefault: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:- Name: ExecuteScriptAction: ACS::FC::ExecuteScriptDescription:en: Run the python scriptzh-cn: 运行Python脚本Properties:runtime: 'python3.10'role: '{{ FCAssumeRole }}'script: |-import oss2import requestsdef handler(event, context):# 获取FC角色credentialauth = oss2.StsAuth(context.credentials.access_key_id, context.credentials.access_key_secret, context.credentials.security_token)endpoint = 'https://oss-{{OSSRegionId}}.aliyuncs.com'bucket = oss2.Bucket(auth, endpoint, '{{OSSBucketName}}')file_url = '{{FileUrl}}'# 下载文件file_content = requests.get(file_url)file_name = file_url.split('/')[-1]# 将文件上传到指定OSSbucket.put_object(f'{{OSSDirectory}}{file_name}', content)

示例脚本说明:

  1. 运行环境默认 python3.10
  2. 函数名称默认 index.handler
  3. 使用模块oss2和requests,详情请查看Python内置模块

文章转载自:
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://www.tj-hxxt.cn/news/31362.html

相关文章:

  • 日本vtuber在b站的钱网站推广app软件
  • 网站404网页界面psd源文件模板企业qq和个人qq有什么区别
  • 电脑做的本地网站手机看百度一下官网首页百度
  • 深圳通信管理局网站国内做网站的公司
  • 上海市建设安全协会网站孟 侠网站外链有多重要
  • 杭州做网站工作室枸橼酸西地那非片的功效与作用
  • 上传网站 php 服务器3000行业关键词
  • 网站开发网校免费网站排名优化在线
  • 制作h5的基本流程网站seo搜索引擎优化教程
  • 广告设计创意作品如何优化关键词搜索
  • 泉州企业建站模板短视频seo软件
  • 广告制作网站现在怎么做网络推广
  • 全球外贸b2b网站大全杭州seo网站哪家好
  • 网站建设设计技巧平板电视seo优化关键词
  • 网站安全建设模板seo关键词排名优
  • 静态网站设计怎么做合肥网站推广
  • 公司网站制作需要多少钱义乌如何提高网站排名seo
  • 最好网站开发公司电话网站seo基本流程
  • 怀柔网站建设网站查询进入
  • 做资源网站怎么赚钱正规网络推广服务
  • 镜像网站做排名广州网站优化运营
  • 网站建设-搜遇网络微信营销推广方案
  • 番禺网站设计公司网络公司经营范围
  • 庆元县住房和城乡建设局网站营销技巧和营销方法
  • 怎么做免费的公司网站成都网络运营推广
  • 网站开发 科技网络推广的主要工作内容
  • 富阳做网站洛洛科技珠海网络推广公司
  • 建立网站后期需要干嘛百度关键词推广一年多少钱
  • 网站制作者seo软件推广哪个好
  • 长沙的网站制作公司青岛seo搜索优化