Home

 

Working with policies

Use the FilesPolicyService commands to add, edit, count, and return information about policies. You apply policies to libraries to set a maximum size on those libraries.

  1. Open a command window and start the wsadmin command line tool as described in the topic, Starting the wsadmin client.

  2. Start the Files script with the following command:

  3. Network deployment:

      execfile("profile_root/config/bin_lc_admin/ filesAdmin.py")
      

  4. Run the following commands to work with policies:


    FilesPolicyService administrative commands

    Command Description

    FilesPolicyService.add(string title, long maximumSize)

    Creates a policy with a specified title and maximum size. Policies set a maximum size limit on libraries.

    A library is a set of files owned by a person or community. It includes all versions of the files, but does not include meta-data such as comments. Parameters:

      title

      The policy title. A required value.

      maximumSize

      The maximum size allowed, in bytes. Must be zero or greater. A value of zero means the size is unlimited.

    When a policy is created, an ID is created for it and returned to you. The ID is in the following standard UUID format: 00000000-0000-0000-0000-000000000000. You must provide policy IDs as parameters when running other FilesPolicyService commands.

    Policies can be applied to libraries using the FilesLibraryService.assignPolicy or FilesLibraryService.assignPolicyBatch commands.

    FilesPolicyService.edit(string policyId, string title, long maximumSize)

    Edits the title and maximum size of a policy with a specified ID. If the ID is for a default policy, the title is not modified. Policies set a maximum size limit on libraries. A library is a set of files owned by a person or community. It includes all versions of the files, but does not include meta-data such as comments. Parameters:

      policyID

      The policy ID in the following standard Universally Unique Identifier (UUID) format: 00000000-0000-0000-0000-000000000000.

      title

      The policy title. A required value.

      maximumSize

      The maximum size allowed, in bytes. Must be zero or greater. A value of zero means the size is unlimited.

    FilesPolicyService.getById(string id)

    Returns information for a single policy specified by an ID. Policies set a maximum size limit on libraries. A library is a set of files owned by a person or community. It includes all versions of the files, but does not include meta-data such as comments. Parameters:

      id

      The policy ID in the following standard Universally Unique Identifier (UUID) format: 00000000-0000-0000-0000-000000000000. The following information is returned:

      • id: the ID

      • title: the policy title

      • maximumSize: the maximum size (in bytes) the library can be, or 0 for unlimited

    FilesPolicyService.browse(string sortOption, string sortAscending, int pageNumber, int itemsPerPage)

    Returns a list of policies with ID, title, and maximum size information, as described for the FilesPolicyService.getById(id) command. Policies set a maximum size limit on libraries. A library is a set of files owned by a person or community. It includes all versions of the files, but does not include meta-data such as comments. Parameters:

      sortOption

      A string value that specifies how to sort the list. The default value is title, but you can also use maximumSize.

      sortAscending

      A string value that specifies whether the list sorts in ascending alphabetical order. This depends on sortOption. If sortOption is title, then this value is true; if sortOption any other value, then this value is false.

      pageNumber

      The number of the page to return. For example, if the itemsPerPage value is 40, and pageNumber value is 2, the command returns items 41 to 80 (page 2) instead of 1 to 40 (page 1).

      itemsPerPage

      The maximum number of policies to list per page. The default value is 20.

    FilesPolicyService.getCount

    Returns the total number of policies. Policies set a maximum size limit on libraries. A library is a set of files owned by a person or community. It includes all versions of the files, but does not include meta-data such as comments.

    FilesPolicyService.editPersonalDefault(long maximumSize)

    Sets the maximum size, in bytes, for the personal library default policy. The default policy is applied to all personal libraries that do not otherwise have a policy. It allows you to control library size as a way of controlling the amount of storage space used.

    A personal library is a set of files owned by one person. It includes all versions of the files, but does not include meta-data such as comments. Parameters:

      maximumSize

      A number representing the maximum size allowed, in bytes, for libraries that the default policy is assigned to.

    FilesPolicyService.editCommunityDefault(long maximumSize)

    Sets the maximum size, in bytes, for the community library default policy. The default policy is applied to all community libraries that do not otherwise have a policy. It allows you to control library size as a way of controlling the amount of storage space used.

    A community library is a set of files owned by a community. It includes all versions of the files, but does not include meta-data such as comments. Parameters:

      maximumSize

      A number representing the maximum size allowed, in bytes, for wikis that the default policy is assigned to.


Administer Files

 

Related tasks

Start the wsadmin client


+

Search Tips   |   Advanced Search