semvec/pypi-packages huggingface dataset:
flops 0.1.4
Python library to easy access flops.ru API.
Keywords: flops.ru API client flops

python-flops
============

Python-flops is python lib to access
`flops.ru <http://bit.ly/flops_ru>`__ API

###Requirements \* Python (2.7, 3.4+) \* requests

Usage
~~~~~

Installation.
^^^^^^^^^^^^^

.. code:: bash

   pip install flops

Credentials.
^^^^^^^^^^^^

.. code:: python

   from flops import FlopsClient

   flops_client = FlopsClient(client_id='client_id', api_key='api_key')
   tariffs = flops_client.get_tariffs()

FlopsClient methods.
^^^^^^^^^^^^^^^^^^^^

.. code:: text

   add_pubkey(self, name, public_key, tenant_id)


   add_vm_ip(self, vm_id, tenant_id)


   change_vm_backup_policy(self, vm_id, quantity, frequency, tenant_id)


   change_vm_cpu(self, vm_id, cpu, tenant_id)


   change_vm_disk(self, vm_id, disk, allow_restart, tenant_id, allow_memory_change)


   change_vm_memory(self, vm_id, memory, allow_restart, tenant_id)


   change_vm_password(self, vm_id, password, send_password, tenant_id)


   change_vm_pubkeys(self, vm_id, key_ids, tenant_id)


   clone_vm(self, vm_id, name, tenant_id, snapshot_id)


   create_vm_snapshot(self, vm_id, name, description, tenant_id)


   delete_pubkey(self, key_id, tenant_id)


   delete_vm(self, vm_id, tenant_id)


   delete_vm_ip(self, vm_id, ip, tenant_id)


   delete_vm_snapshot(self, vm_id, snapshot_id, delete_children, tenant_id)


   edit_pubkey(self, key_id, tenant_id, name, public_key)


   get_distributions(self,)


   get_distributions_by_name(self, name, match_type)


   get_operation_status(self, operation_id)


   get_pubkey(self, key_id)


   get_pubkeys(self,)


   get_pubkeys_by_name(self, name, match_type)


   get_software(self,)


   get_tariffs(self, for_windows, order_by, on_demand)


   get_tenants(self,)


   get_vm(self, vm_id)


   get_vm_backups(self, vm_id)


   get_vm_snapshots(self, vm_id)


   get_vms(self,)


   get_vms_by_name(self, name, match_type)


   install_vm(self, name, distribution_id, tariff_id, tenant_id, memory, disk, cpu, ip_count, password, send_password, open_support_access, public_key_ids, software_ids)


   move_vm_ip(self, vm_id, to_vm_id, ip, tenant_id)


   poweroff_vm(self, vm_id, tenant_id)


   reboot_vm(self, vm_id, tenant_id)


   reinstall_vm(self, vm_id, name, distribution_id, tariff_id, tenant_id, memory, disk, cpu, password, send_password, open_support_access, public_key_ids, software_ids)


   rename_vm(self, vm_id, new_name, tenant_id)


   reset_vm(self, vm_id, tenant_id)


   rollback_vm_backup(self, vm_id, backup, create_backup, tenant_id)


   rollback_vm_snapshot(self, vm_id, snapshot_id, tenant_id)


   shutdown_vm(self, vm_id, tenant_id)


   start_vm(self, vm_id, tenant_id)


   wait_for_operation(self, operation_id, timeout, polling_time)

Testing
~~~~~~~

Install development requirements.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: bash

   pip install pytest pytest-env tcpping2

Run the tests.
^^^^^^^^^^^^^^

Warning: Your account could be charged for VMs creation
'''''''''''''''''''''''''''''''''''''''''''''''''''''''

.. code:: bash

   export CLIENT_ID=<CLIENT_ID>
   export API_KEY=<API_KEY>
   pytest flops/tests/*
pyworks 0.9.1
An Task framework
Keywords: actors concurrency development

PyWorks - a small concurrent framework for Python

  Ever since i first worked with threads in Java 15 years ago, I have been
struggeling with the concept. Before that I was used to C and a homegrown "OS"
called Daros. It had Task "preemtive processes", Messages and Queues. For me
it was much easier to comprehend the one Task == one thread concept.
No synchronized keyword, only place you had to take a little care was if you
used shared memory (which was rare)

  In 2004 we therefore inplemented Coworks in Java, a concurrent object model
for Java. Also known as the Task pattern. Since then we have implemented many
larger projects all over the world. The concept is easy for developers to
understand and generally performs very well.

  The other evening I decided to try to implement my version of Coworks in
Python. Inspired by Donovan Preston's (@donovanpreston) talk at Pycon 2010
about his implementation of Task's in Python I decided to try my self.

  Pyworks implements two types of concurrent classes: Actor and Task. Actor
is a simple concurrent class and Task is a specialized form of Actor. Actor
has a few simple methods: actor, timeout, notify and observe. Task is more
complex supporting State pattern and methods for controlled startup sequence,
configuration etc.

  It is a simple as it gets. Subclasses of Task run in their own thread.
Task's can access each other by calling self.actor("SomeActor") to get
a Proxy for that Task. You can call all methods on the other Task. The Method
is sent on a Queue and executed in the other Task's thread.

  If you need a return value you can use the Future patten.

  Every Task can listen on other Task's via the self.observe("SomeActor")
method. A listener must implement all Output methods of the Task being
listened on.

  Every Task has a State (default is it self), which handle all incoming
Methods. This means that States in Task are very easy to implement.

  No thought or time whatsoever has been put into performance, this is a study
only.

run test test program by simply doing:
$ python pywork.py --run

Works on python3

Rene Nejsum
rene@pylots.com

Copyright (C) 2012-