Coder Social home page Coder Social logo

synology-srm's Introduction

Synology SRM API

Build status PyPi version PyPI pyversions

Python 3 library to use the Synology SRM (Synology Router Manager) API. This is NOT the same thing as Synology DSM (DiskStation Manager).

This library should work with the following devices.

  • RT1900ac
  • RT2600ac

It's not possible to create another account in SRM with admin permissions. You'll need to use your admin account (or the one you renamed at creation).

Usage

import synology_srm

client = synology_srm.Client(
    host='192.168.1.254',
    port=8001,
    https=True,
    username='admin',
    password='admin',
)

You can now access all namespaces from the API. The following methods are availabe.

  • Base
    • getinfo_encryption()
    • query_info()
  • Core
    • list_ddns_extip()
    • list_ddns_record()
    • get_system_utilization()
    • get_network_nsm_device(filters={})
    • get_ngfw_traffic(interval=live|day|week|month)
    • list_certificate()
    • export_certificate(path=certificate.zip)
  • Mesh
    • get_network_wanstatus()
    • get_network_wifidevice()
    • get_system_info()

For instance, to list all endpoints available in the API.

endpoints = client.base.query_info()

for endpoint, config in endpoints.items():
    print("API endpoint {} (minVersion={}, maxVersion={})".format(
        endpoint,
        config['minVersion'],
        config['maxVersion'],
    ))

Manual endpoints

It's possible to target endpoints not directly supported by this library by using the raw http client.

response = client.http.call(
    endpoint='entry.cgi',
    api='SYNO.Core.System.Utilization',
    method='get',
    version=1,
)

HTTPS auto-signed certificate

You can disable the HTTPS certificate verification if you are using a self-signed certificate.

client.http.disable_https_verify()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.