diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-04-12 01:49:51 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-04-12 01:49:51 +0000 |
| commit | a0fec6d11111c7b1e598c1d41dcd79e751961c8c (patch) | |
| tree | cbd76ac4b37bdc700ffce7bf746fa783266d5c45 /python-renovosolutions-aws-cdk-one-time-event.spec | |
| parent | 9b0bc6f57fbe244649cee49be3f0e7c161d52a3b (diff) | |
automatic import of python-renovosolutions-aws-cdk-one-time-event
Diffstat (limited to 'python-renovosolutions-aws-cdk-one-time-event.spec')
| -rw-r--r-- | python-renovosolutions-aws-cdk-one-time-event.spec | 296 |
1 files changed, 296 insertions, 0 deletions
diff --git a/python-renovosolutions-aws-cdk-one-time-event.spec b/python-renovosolutions-aws-cdk-one-time-event.spec new file mode 100644 index 0000000..49eeeb0 --- /dev/null +++ b/python-renovosolutions-aws-cdk-one-time-event.spec @@ -0,0 +1,296 @@ +%global _empty_manifest_terminate_build 0 +Name: python-renovosolutions.aws-cdk-one-time-event +Version: 2.1.107 +Release: 1 +Summary: AWS CDK Construct Library to create one time event schedules. +License: Apache-2.0 +URL: https://github.com/RenovoSolutions/cdk-library-one-time-event.git +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/b4/b4/622df1012369e4179b89dfaa8737571302149006d7c09ea99da5dad95482/renovosolutions.aws-cdk-one-time-event-2.1.107.tar.gz +BuildArch: noarch + +Requires: python3-aws-cdk-lib +Requires: python3-constructs +Requires: python3-jsii +Requires: python3-publication +Requires: python3-typeguard + +%description +# cdk-library-one-time-event + +[](https://github.com/RenovoSolutions/cdk-library-one-time-event/workflows/build.yml) + +An AWS CDK Construct library to create one time event [schedules](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-events.Schedule.html). + +## Features + +* Create two types of event [schedules](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-events.Schedule.html) easily: + + * On Deployment: An one time event schedule for directly after deployment. Defaults to 10mins after. + * At: A one time even schedule for any future `Date()` + +## API Doc + +See [API](API.md) + +## Examples + +### Typescript - run after deploy, offset 15mins + +``` +import * as cdk from '@aws-cdk/core'; +import * as lambda from '@aws-cdk/aws-lambda'; +import * as oneTimeEvents from '@renovosolutions/cdk-library-one-time-event'; + +export class CdkExampleLambdaStack extends cdk.Stack { + constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { + super(scope, id, props); + + const handler = new lambda.Function(this, 'handler', { + runtime: lambda.Runtime.PYTHON_3_8, + code: lambda.Code.fromAsset(functionDir + '/function.zip'), + handler: 'index.handler', + }); + + new events.Rule(this, 'triggerImmediate', { + schedule: new oneTimeEvents.OnDeploy(this, 'schedule', { + offsetMinutes: 15 + }).schedule, + targets: [new targets.LambdaFunction(this.handler)], + }); +``` + +### Typescript - run in 24 hours + +``` +import * as cdk from '@aws-cdk/core'; +import * as lambda from '@aws-cdk/aws-lambda'; +import * as oneTimeEvents from '@renovosolutions/cdk-library-one-time-event'; + +export class CdkExampleLambdaStack extends cdk.Stack { + constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { + super(scope, id, props); + + const handler = new lambda.Function(this, 'handler', { + runtime: lambda.Runtime.PYTHON_3_8, + code: lambda.Code.fromAsset(functionDir + '/function.zip'), + handler: 'index.handler', + }); + + var tomorrow = new Date() + tomorrow.setDate(tomorrow.getDate() + 1) + + new events.Rule(this, 'triggerImmediate', { + schedule: new oneTimeEvents.At(this, 'schedule', { + date: tomorrow + }).schedule, + targets: [new targets.LambdaFunction(this.handler)], + }); +``` + + + + +%package -n python3-renovosolutions.aws-cdk-one-time-event +Summary: AWS CDK Construct Library to create one time event schedules. +Provides: python-renovosolutions.aws-cdk-one-time-event +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-renovosolutions.aws-cdk-one-time-event +# cdk-library-one-time-event + +[](https://github.com/RenovoSolutions/cdk-library-one-time-event/workflows/build.yml) + +An AWS CDK Construct library to create one time event [schedules](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-events.Schedule.html). + +## Features + +* Create two types of event [schedules](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-events.Schedule.html) easily: + + * On Deployment: An one time event schedule for directly after deployment. Defaults to 10mins after. + * At: A one time even schedule for any future `Date()` + +## API Doc + +See [API](API.md) + +## Examples + +### Typescript - run after deploy, offset 15mins + +``` +import * as cdk from '@aws-cdk/core'; +import * as lambda from '@aws-cdk/aws-lambda'; +import * as oneTimeEvents from '@renovosolutions/cdk-library-one-time-event'; + +export class CdkExampleLambdaStack extends cdk.Stack { + constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { + super(scope, id, props); + + const handler = new lambda.Function(this, 'handler', { + runtime: lambda.Runtime.PYTHON_3_8, + code: lambda.Code.fromAsset(functionDir + '/function.zip'), + handler: 'index.handler', + }); + + new events.Rule(this, 'triggerImmediate', { + schedule: new oneTimeEvents.OnDeploy(this, 'schedule', { + offsetMinutes: 15 + }).schedule, + targets: [new targets.LambdaFunction(this.handler)], + }); +``` + +### Typescript - run in 24 hours + +``` +import * as cdk from '@aws-cdk/core'; +import * as lambda from '@aws-cdk/aws-lambda'; +import * as oneTimeEvents from '@renovosolutions/cdk-library-one-time-event'; + +export class CdkExampleLambdaStack extends cdk.Stack { + constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { + super(scope, id, props); + + const handler = new lambda.Function(this, 'handler', { + runtime: lambda.Runtime.PYTHON_3_8, + code: lambda.Code.fromAsset(functionDir + '/function.zip'), + handler: 'index.handler', + }); + + var tomorrow = new Date() + tomorrow.setDate(tomorrow.getDate() + 1) + + new events.Rule(this, 'triggerImmediate', { + schedule: new oneTimeEvents.At(this, 'schedule', { + date: tomorrow + }).schedule, + targets: [new targets.LambdaFunction(this.handler)], + }); +``` + + + + +%package help +Summary: Development documents and examples for renovosolutions.aws-cdk-one-time-event +Provides: python3-renovosolutions.aws-cdk-one-time-event-doc +%description help +# cdk-library-one-time-event + +[](https://github.com/RenovoSolutions/cdk-library-one-time-event/workflows/build.yml) + +An AWS CDK Construct library to create one time event [schedules](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-events.Schedule.html). + +## Features + +* Create two types of event [schedules](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-events.Schedule.html) easily: + + * On Deployment: An one time event schedule for directly after deployment. Defaults to 10mins after. + * At: A one time even schedule for any future `Date()` + +## API Doc + +See [API](API.md) + +## Examples + +### Typescript - run after deploy, offset 15mins + +``` +import * as cdk from '@aws-cdk/core'; +import * as lambda from '@aws-cdk/aws-lambda'; +import * as oneTimeEvents from '@renovosolutions/cdk-library-one-time-event'; + +export class CdkExampleLambdaStack extends cdk.Stack { + constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { + super(scope, id, props); + + const handler = new lambda.Function(this, 'handler', { + runtime: lambda.Runtime.PYTHON_3_8, + code: lambda.Code.fromAsset(functionDir + '/function.zip'), + handler: 'index.handler', + }); + + new events.Rule(this, 'triggerImmediate', { + schedule: new oneTimeEvents.OnDeploy(this, 'schedule', { + offsetMinutes: 15 + }).schedule, + targets: [new targets.LambdaFunction(this.handler)], + }); +``` + +### Typescript - run in 24 hours + +``` +import * as cdk from '@aws-cdk/core'; +import * as lambda from '@aws-cdk/aws-lambda'; +import * as oneTimeEvents from '@renovosolutions/cdk-library-one-time-event'; + +export class CdkExampleLambdaStack extends cdk.Stack { + constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { + super(scope, id, props); + + const handler = new lambda.Function(this, 'handler', { + runtime: lambda.Runtime.PYTHON_3_8, + code: lambda.Code.fromAsset(functionDir + '/function.zip'), + handler: 'index.handler', + }); + + var tomorrow = new Date() + tomorrow.setDate(tomorrow.getDate() + 1) + + new events.Rule(this, 'triggerImmediate', { + schedule: new oneTimeEvents.At(this, 'schedule', { + date: tomorrow + }).schedule, + targets: [new targets.LambdaFunction(this.handler)], + }); +``` + + + + +%prep +%autosetup -n renovosolutions.aws-cdk-one-time-event-2.1.107 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-renovosolutions.aws-cdk-one-time-event -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed Apr 12 2023 Python_Bot <Python_Bot@openeuler.org> - 2.1.107-1 +- Package Spec generated |
