def cli(obj, environment, service, resource, event, group, tags, customer, start, duration, text, delete):
    """Suppress alerts for specified duration based on alert attributes."""
    client = obj['client']
    if delete:
        client.delete_blackout(delete)
    else:
        if not environment:
            raise click.UsageError('Missing option "--environment" / "-E".')
        try:
            blackout = client.create_blackout(
                environment=environment,
                service=service,
                resource=resource,
                event=event,
                group=group,
                tags=tags,
                customer=customer,
                start=start,
                duration=duration,
                text=text
            )
        except Exception as e:
            click.echo('ERROR: {}'.format(e))
            sys.exit(1)
        click.echo(blackout.id)
def cli ( obj , environment , service , resource , event , group , tags , customer , start , duration , text , delete ) : client = obj [ 'client' ] if delete : client . delete_blackout ( delete ) else : if not environment : raise click . UsageError ( 'Missing option "--environment" / "-E".' ) try : blackout = client . create_blackout ( environment = environment , service = service , resource = resource , event = event , group = group , tags = tags , customer = customer , start = start , duration = duration , text = text ) except Exception as e : click . echo ( 'ERROR: {}' . format ( e ) ) sys . exit ( 1 ) click . echo ( blackout . id )
Suppress alerts for specified duration based on alert attributes.