VirtualMedia dbus interface definition.

This interfaces definition was created on base of the VirtualMedia
design proposed in this document:
	https://github.com/openbmc/docs/blob/master/designs/VirtualMedia.md

It also takes into account the design changes proposed in this review:
	https://gerrit.openbmc-project.xyz/c/openbmc/docs/+/29573

Signed-off-by: Zbigniew Kurzynski <zbigniew.kurzynski@intel.com>
Change-Id: Ie5b1cdb9a8e01a54e79784837edf3b1d1f1fb017
diff --git a/xyz/openbmc_project/VirtualMedia/Legacy.interface.yaml b/xyz/openbmc_project/VirtualMedia/Legacy.interface.yaml
new file mode 100644
index 0000000..2a028dd
--- /dev/null
+++ b/xyz/openbmc_project/VirtualMedia/Legacy.interface.yaml
@@ -0,0 +1,37 @@
+description: >
+    This interface provides methods for mounting and unmounting images
+    using the legacy mode.
+
+methods:
+    - name: Mount
+      description: Perform a mount to HOST operation on given object.
+      parameters:
+        - name: ImageURL
+          type: string
+          description: >
+              Url to image. It should start with either `smb://` or
+              `https://` prefix
+        - name: ReadWrite
+          type: boolean
+          description: False if the image should be read-only.
+        - name: FileDescriptor
+          type: variant[int32,unixfd]
+          description: >
+              File descriptor of named pipe used for passing null-delimited
+              secret data (username and password). When there is no data to
+              pass `-1` should be passed as `INT`.
+      returns:
+        - name: Status
+          type: boolean
+          description: mounting status. True on success.
+      errors:
+        - xyz.openbmc_project.Common.Error.InternalFailure
+
+    - name: Unmount
+      description: Perform an unmount from HOST on given object.
+      returns:
+        - name: Status
+          type: boolean
+          description: the unmount status. True on success.
+      errors:
+        - xyz.openbmc_project.Common.Error.InternalFailure
diff --git a/xyz/openbmc_project/VirtualMedia/MountPoint.interface.yaml b/xyz/openbmc_project/VirtualMedia/MountPoint.interface.yaml
new file mode 100644
index 0000000..e21b3cf
--- /dev/null
+++ b/xyz/openbmc_project/VirtualMedia/MountPoint.interface.yaml
@@ -0,0 +1,73 @@
+description: >
+    Defines the object configuration like mounting mode, image paths,
+    timouts etc.
+
+properties:
+    - name: EndPointId
+      type: string
+      description: Name of the Network Block Devices that will be used.
+      flags:
+        - const
+      errors:
+          - xyz.openbmc_project.Common.Error.InternalFailure
+
+    - name: Mode
+      type: byte
+      description: Mounting mode, supported values are 0-proxy, 1-legacy.
+      flags:
+        - const
+      errors:
+          - xyz.openbmc_project.Common.Error.InternalFailure
+
+    - name: Device
+      type: string
+      description: Name of mounted device.
+      flags:
+        - const
+      errors:
+          - xyz.openbmc_project.Common.Error.InternalFailure
+
+    - name: Socket
+      type: string
+      description: Path to socket used to mount the image.
+      flags:
+        - const
+      errors:
+          - xyz.openbmc_project.Common.Error.InternalFailure
+
+    - name: Timeout
+      type: uint16
+      description: >
+            Client connection timeout in seconds.
+            If VirtualMedia cannot connect successfully with served
+            image the connection is dropped after that timeout.
+      flags:
+        - const
+      errors:
+          - xyz.openbmc_project.Common.Error.InternalFailure
+
+    - name: BlockSize
+      type: uint16
+      description: Size of data block.
+      flags:
+        - const
+      errors:
+          - xyz.openbmc_project.Common.Error.InternalFailure
+
+    - name: RemainingInactivityTimeout
+      type: uint16
+      description: >
+            Seconds to drop connection by server, for activated endpoint,
+            0 otherwise.
+      flags:
+        - const
+      errors:
+          - xyz.openbmc_project.Common.Error.InternalFailure
+
+    - name: ImageURL
+      type: string
+      description: URL to mounted image.
+      flags:
+        - const
+      errors:
+          - xyz.openbmc_project.Common.Error.InternalFailure
diff --git a/xyz/openbmc_project/VirtualMedia/Process.interface.yaml b/xyz/openbmc_project/VirtualMedia/Process.interface.yaml
new file mode 100644
index 0000000..069bc2d
--- /dev/null
+++ b/xyz/openbmc_project/VirtualMedia/Process.interface.yaml
@@ -0,0 +1,21 @@
+description: >
+    Provides general information about the object status.
+
+properties:
+    - name: Active
+      type: boolean
+      description: >
+          `True`, if object is occupied by active process, `False` otherwise.
+      flags:
+        - const
+      errors:
+          - xyz.openbmc_project.Common.Error.InternalFailure
+
+    - name: ExitCode
+      type: int32
+      description: >
+          If process terminates this property will contain returned exit code.
+      flags:
+        - const
+      errors:
+          - xyz.openbmc_project.Common.Error.InternalFailure
\ No newline at end of file
diff --git a/xyz/openbmc_project/VirtualMedia/Proxy.interface.yaml b/xyz/openbmc_project/VirtualMedia/Proxy.interface.yaml
new file mode 100644
index 0000000..a43e8e2
--- /dev/null
+++ b/xyz/openbmc_project/VirtualMedia/Proxy.interface.yaml
@@ -0,0 +1,21 @@
+description: >
+    This interface provides methods for mounting and unmounting images.
+
+methods:
+    - name: Mount
+      description: Perform a mount to HOST operation on given object.
+      returns:
+        - name: Status
+          type: boolean
+          description: mounting status. True on success.
+      errors:
+        - xyz.openbmc_project.Common.Error.InternalFailure
+
+    - name: Unmount
+      description: Perform an unmount from HOST on given object.
+      returns:
+        - name: Status
+          type: boolean
+          description: the unmount status. True on success.
+      errors:
+        - xyz.openbmc_project.Common.Error.InternalFailure
diff --git a/xyz/openbmc_project/VirtualMedia/README.md b/xyz/openbmc_project/VirtualMedia/README.md
new file mode 100644
index 0000000..40afa3f
--- /dev/null
+++ b/xyz/openbmc_project/VirtualMedia/README.md
@@ -0,0 +1,4 @@
+# Virtual Media
+
+All exposed objects, their paths and interfaces are described
+in [openbmc/docs/designs/VirtualMedia.md](https://github.com/openbmc/docs/blob/master/designs/VirtualMedia.md).
\ No newline at end of file
diff --git a/xyz/openbmc_project/VirtualMedia/Stats.interface.yaml b/xyz/openbmc_project/VirtualMedia/Stats.interface.yaml
new file mode 100644
index 0000000..9895b06
--- /dev/null
+++ b/xyz/openbmc_project/VirtualMedia/Stats.interface.yaml
@@ -0,0 +1,19 @@
+description: >
+    Provides statistic information about object.
+
+properties:
+    - name: ReadIO
+      type: uint64
+      description: Number of read IOs since image mounting.
+      flags:
+        - const
+      errors:
+          - xyz.openbmc_project.Common.Error.InternalFailure
+
+    - name: WriteIO
+      type: uint64
+      description: Number of write IOs since image mounting.
+      flags:
+        - const
+      errors:
+          - xyz.openbmc_project.Common.Error.InternalFailure
\ No newline at end of file